package com.yonyou.pmclouds.workflow.mapper;

import com.yonyou.pmclouds.basecom.dao.BaseMapper;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.workflow.entity.ProcessDefinitionVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface ProcessDefinitionMapper extends BaseMapper<ProcessDefinitionVO> {

    ProcessDefinitionVO[] getStartProcessByType(@Param("tenantId") String tenantId,
                                                @Param("billType") String billType,
                                                @Param("pkOrg") String pkOrg) throws BusinessException;

    ProcessDefinitionVO[] queryDefinitionByTenantId(@Param("tenantId") String tenantId,
                                                    @Param("billType") String billType,
                                                    @Param("start") int start,
                                                    @Param("size") int size,
                                                    @Param("pkOrg") String pkOrg) throws BusinessException;

    int countDefinitionByTenantId(@Param("tenantId") String tenantId, @Param("billType") String billType,
                                  @Param("pkOrg") String pkOrg) throws BusinessException;

    ProcessDefinitionVO[] queryByProcessKey(@Param("processKey") String processKey);

    ProcessDefinitionVO[] queryByNameAndOrg(@Param("processName") String processName,
                                      @Param("tenantId") String tenantId,
                                      @Param("pkOrg") String pkOrg);


}
